import type { UserRoutesDefine } from "@/types/common.d.ts"
/**
 * 后端返回的用户拥有的路由信息格式
 * 获取时机:登录成功后后端返回,前端存入到pinia中
 * 用于:
 * 1.动态路由--tabs
 * 2.菜单的计算
 */
const userRoutes: UserRoutesDefine = [
  {
    path: "authority",
    componentPath: "authority/AuthorityHome",
    children: [
      {
        path: "manage",
        componentPath: "authority/AuthorityManage",
        meta:{
          authorityName:"权限管理",
          showInMenu:true,
          icon:"School"
        }
      },
      {
        meta:{
          authorityName:"新增",
          showInMenu:false,
        }
      },
      {
        meta:{
          authorityName:"编辑",
          showInMenu:false,
        }
      },
      {
        meta:{
          authorityName:"删除",
          showInMenu:false,
        }
      }
    ]
  },
  {
    path: "role",
    componentPath: "role/RoleHome",
    children: [
      {
        path: "manage",
        componentPath: "role/RoleManage",
        meta:{
          showInMenu:true,
          authorityName:"角色管理",
          icon:"Connection"
        }
      },
      {
        meta:{
          authorityName:"新增",
          showInMenu:false,
        }
      },
      {
        meta:{
          authorityName:"编辑",
          showInMenu:false,
        }
      },
      {
        meta:{
          authorityName:"删除",
          showInMenu:false,
        }
      },
      {
        meta:{
          authorityName:"分配权限",
          showInMenu:false,
        }
      }
    ]
  },
  {
    path: "user",
    componentPath: "user/UserHome",
    children: [
      {
        path: "manage",
        componentPath: "user/UserManage",
        meta:{
          authorityName:"用户管理",
          showInMenu:true,
          icon:"School"
        }
      }
    ]
  },
  {
    path: "logs",
    componentPath: "logs/LogsHome",
    children: [
      {
        path: "manage",
        componentPath: "logs/LogsManage",
        meta:{
          authorityName:"系统日志",
          showInMenu:true,
          icon:"ElementPlus"
        }
      }
    ]
  },
  {
    path: "resource",
    componentPath: "resource/ResourceHome",
    children: [
      {
        path: "manage",
        componentPath: "user/UserManage",
        meta:{
          authorityName:"用户管理",
          showInMenu:true,
          icon:"School"
        }
      }
    ]
  }
]

export default userRoutes